<?php
/**
 * Patient Signal details view page 5. Used in view action in PatientSignalController.
 *
 * @package   views
 * @subpackage patientSignal
 * @since     1.0
 * @filesource
 */

if (Yii::app()->user->checkAccess('signalDownload',array('organizationId'=>$model->organizationId))){
	?>
<h4>Files</h4>
<ul class="signal-files-list">
<?php
$signalFiles=$model->signalFiles;
foreach ($signalFiles as $signalFile){
	?>
	<li><?php echo CHtml::link($signalFile->filename,array('patientSignal/downloadFile','fileId'=>$signalFile->id))?></li>
	<?php
}
?>
</ul>

<?php
	if($model->status==PatientSignal::STATUS_PROCESSED){
	?>
<h4>Result</h4>
<ul class="signal-files-list">

	<li><?php echo CHtml::link($model->resultFileName,array('patientSignal/downloadResult','id'=>$model->id))?></li>
</ul>

<?php
	}
}
else{
	echo 'You are not permitted to download files';
}